import { defineStore } from "pinia";
export const useTodoStore = defineStore("todo", {
    state: () => ({
        todos: [
            {id: 1, text: "Learn Vue", completed: false},
            {id: 2, text: "Learn Pinia", completed: false},
            {id: 3, text: "learn router", completed: false}
        ]
    }),
    getters: {
        
    },
    actions: {
        addTodo(newtext)
        {
            const newTodo = {
                id: this.todos.length + 1,
                text: newtext,
                completed: false
            };
            this.todos.push(newTodo);
        } 
    }
});